<script setup lang="ts">
const emit = defineEmits<{
  (e: 'update:msg', val: string): void
  (e: 'changeStr', val: string): void
}>()
defineProps<{
  msg: string
  str1?: string
}>()
</script>

<template>
  <div class="com-page">com: modelValue: {{ msg }}</div>
  <button @click="emit('update:msg', '值改变了')">改str</button>
  <div>str1:{{ str1 }}</div>
  <button @click="emit('changeStr', 'str1改变了')">对比改变str1</button>
</template>

<style lang="scss" scoped></style>
